import * as constants from '../Constants'
import { get, GET_OUT_LIST, GET_OUT_SAMPLE_EXPERESS } from '../../service/api'


export interface GetOutList {
  type: constants.GetOutList
  payload: Promise<any>
}

export interface GetOutList_PENDING {
  type: constants.GetOutList_PENDING
  payload: Promise<any>
}

export interface GetOutList_FULFILLED {
  type: constants.GetOutList_FULFILLED
  payload: any
}

export interface GetOutList_PAGE {
  type: constants.GetOutList_PAGE
  payload: any
}

export interface RECORD_Out {
  type: constants.RECORD_Out
  payload: Promise<any>
}

export interface RECORD_Out_FULFILLED {
  type: constants.RECORD_Out_FULFILLED
  payload: Promise<any>
}

export type OutAction = GetOutList | 
  GetOutList_FULFILLED | 
  GetOutList_PENDING | 
  GetOutList_PAGE |
  RECORD_Out |
  RECORD_Out_FULFILLED


export function getOutList(param: any): GetOutList {
  return {
    type: constants.GetOutList,
    payload: get(GET_OUT_LIST, param)
  }
}
export function recordOut(param: any): RECORD_Out {
  return {
    type: constants.RECORD_Out,
    payload: get(GET_OUT_SAMPLE_EXPERESS, param)
  }
}
export function page(page: any): GetOutList_PAGE {
  return {
    type: constants.GetOutList_PAGE,
    payload: page
  }
}